NetLogo banner

Home
Download
Help
Forum
Resources
Extensions
FAQ
NetLogo Publications
Contact Us
Donate

Models:
Library
Community
Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Web
Printable
Chinese
Czech
Farsi / Persian
Japanese
Spanish

  Donate

NetLogo User Community Models

(back to the NetLogo User Community Models)

[screen shot]

Download
If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".

Try It in NetLogo Web

## WHAT IS IT?

This is a simple model of Hardy-Weinberg equilibrium and genetic drift in a diploid population. Here the organisms mate randomly and each genotype has the same fitness. Allele frequencies evolve purely by genetic drift.

## HOW TO USE IT

The CARRYING-CAPACITY slider sets the carrying capacity of the terrain. The model is initialized to have a total population of CARRYING-CAPACITY with half the population reds and half blues.

The STARING FREQ OF HOMOZYGOUS AA slider sets what proportion of the intial population has the AA homozygous genotype.

The STARING FREQ OF HETEROZYGOTES slider sets what proportion of the intial population has the Aa heterozygous genotype.

Note that those two sliders then determine the remaining frequency of the aa homozygous genotype.

The GO button runs the model.

The ONE GENERATION button simulates a single generation (single tick).

The RUN-EXPERIMENT button lets you experiment with many trials at the same settings. This button outputs the number of ticks it takes for either the reds or the blues to die out given a particular set of values for the sliders. After each extinction occurs, the world is cleared and another run begins with the same settings. This way you can see the variance of the number of generations until extinction.

The POPULATIONS plot displays the number of individuals with the three different genotypes: AA (reds), Aa (blues) and aa (green).

The monitor windows Freq AA, Freq Aa and Freq aa, show the frequencies of the 3 different genotypes in the population.

## THINGS TO DO

Set the carrying capacity to 4,000. Set the initial frequency of AA homozygote to 0.5 and the initial frequency of the heterozygotes to 0. Now simulate one generation. What are the resulting frequencies of the 3 genotypes?

Now run the model forward by pressing the GO button. What happens to the 3 genotypes?

Now set the initial frequency of AA homozygote to 0.8 and the initial frequency of the heterozygotes to 0, and reset the model by pressing the SETUP button. Simulate one generation. What are the resulting frequencies of the 3 genotypes?

Now run the model forward by pressing the GO button. What happens to the 3 genotypes?

Now set the carrying capacity to 80 and repeat the experiments above (starting at 0.5 AAs, and then starting at 0.8 AAs). What happens after 1 generation? What happens if you let those models run?

Run an experiment with carrying capacity at 80, starting AAs at 0.5 and starting Aa's at 0. Let it run at least 10 times. How often does the A allele go to fixation? What do you think the chance is that the A allele will go to fixation? Why?

Run an experiment with carrying capacity at 10, starting AA's at 0.9 and staring Aa's at 0.1. How many A alleles are in the starting population? How many a alleles are in the starting population? Before you run the model, predict the probability that the a allele will go to fixation. Let the experiment run enough times that you see the a allele go to fixation at least 4 times? What was the observed probability that it went to fixation? What do you now think is the probability that the a allele goes to fixation. Why?

When the a allele did go to fixation, what was the average number of generations it took to get to fixation? Is this consistent with the predicted number of generations it should take on average? If not, why do you think you got a different answer? How would you test that?

## EXTENDING THE MODEL

## HOW TO CITE

This model was based on the Simple Birth Rates model by U. Wilensky, and then extended by Carlo C. Maley in 2018.

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the original model itself:

* Wilensky, U. (1997). NetLogo Simple Birth Rates model. http://ccl.northwestern.edu/netlogo/models/SimpleBirthRates. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Please cite the NetLogo software as:

* Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

## COPYRIGHT AND LICENSE

Copyright 1997 Uri Wilensky.

![CC BY-NC-SA 3.0](http://ccl.northwestern.edu/images/creativecommons/byncsa.png)

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612.

This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2001.

<!-- 1997 2001 -->

(back to the NetLogo User Community Models)